package com.platform.open.enums;

import com.platform.comm.enums.IDictEntry;
import com.platform.comm.enums.IEnumItem;

/**
 * @author liujizheng
 * @version 1.0
 * @ClassName ServiceCreateType
 * @Description 字段验证方式
 * @date 2021/5/27 11:07
 */
public enum VerifyWay implements IDictEntry, IEnumItem {
    /**
     * 身份证
     */
    Identify("Identify", "身份证"),
    /**
     * 时间
     */
    Date("Date", "时间"),
    /**
     * 数值
     */
    Number("Number", "数值"),
    /**
     * 缺省不验证
     */
    None("None", "缺省不验证"),
    /**
     * 社会统一代码
     */
    Unicode("Unicode", "社会统一代码"),

    /**
     * 正则表达式
     */
    REGEX("REGEX", "正则表达式");

    private final String key;
    private final String title;

    VerifyWay(String key, String title) {
        this.key = key;
        this.title = title;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.title;
    }

    @Override
    public Object getData() {
        return this;
    }

    @Override
    public boolean is(String code) {
        return this.name().equals(code);
    }
}
